<template>
  <div class="app">
    <div class="homeList">
        <div class="tabbar">
            <h3>猜你喜欢</h3>
            <div class="prevTab">
                 <div class="tabs" v-for="(item,index) in prevTab" :key="index">{{item}}</div>
            </div>
            <div class="nextTab">
                 <div class="tabs" v-for="(item,index) in nextTab" :key="index">{{item}}</div>
            </div>
        </div>

        <div class="list">
            <div class="box" v-for="(item,index) in shop_list" :key="index">
                <img :src="item.picUrl" alt="">
                <div class="text">
                    <h3>{{item.name}}</h3>
                    <div class="tet">
                         <p><span>4.3</span> <span>{{item.monthSalesTip}}</span></p>
                    </div>
                   
                    <div class="txt">
                        <p><span>{{item.minPriceTip}}</span><span>{{item.shippingFeeTip}}</span></p>
                        <p><span>{{item.deliveryTimeTip}}</span><span>{{item.distance}}</span></p>
                    </div>
                    
                </div>
            </div>
        </div>
    </div>
  </div>
</template>

<script>
import {shop_list} from '../utils/api'
export default {
    data(){
        return{
            shop_list:[],
            prevTab:["综合排序","距离最近","销量最高","筛选"],
            nextTab:["年货节热卖","津贴联盟","满减忧惠","品质联盟"]
        }
    },
    mounted(){
      shop_list().then((res)=>{
        this.shop_list=res.data.list
        })
    }
      
    
}
</script>

<style lang="scss" scoped>
.homeList{
    padding: 0 10px;
    .prevTab,
    .nextTab{
    display: flex;
    justify-content: space-between;
    line-height: 60px;
    }
    .nextTab{
    line-height: 20px;
      .tabs{
            margin-right: 5px; 
            padding: 5px 6px;
            background-color: #ece9e9;
        }
    }
}
.box{
    display: flex;
    margin-top: 10px;
    img{
        width: 90px;
        height: 90px;
    }
    .txt{
        display: flex;
        justify-content: space-between;
        color: gray;
        font-size: 14px;
        p:last-child{
            right: 0;
        }
    }
    .tet{
        color: orangered;
    }
}

</style>